//该文件用于创建vuex中最核心的store
import Vue from 'vue'
//引入vuex
import Vuex from 'vuex'

Vue.use(Vuex)
//准备actions，用于响应组件中的动作
const actions = {
    
}

//准备mutations，用于操作数据（state）
const mutations = {
    SetSubjectColor(state,value){
        state.subjectColor = value
    },
    SetSubjectFont(state,value){
        state.subjectFont = value
    },
    LoginOrResign(state,value){
        state.LoginOrResign = value
    },
    DarkOrLight(state,value){
        state.isDark = value
    },
    Reflesh(state,value){
        state.reflesh = value
    },
}

//准备state，用于存储数据
const state = {
    subjectColor:'red',
    subjectFont:'18px',
    LoginOrResign:true,
    isDark:false,
    reflesh:false
}

//创建store
const store = new Vuex.Store({
    actions,
    mutations,
    state
})

//导出store
export default store